StupidBeauty
Read times:971Posted at:Wed Oct 2 21:13:57 2013
- no title specified

转载:使用apache commons-io的FileUtils.copyFile简单地复制文件

FileUtils.copyFile(source, target);即可将文件从source 复制到 target .可用于安卓项目。记得在项目里加上 commons-io的库。

http://ajava.org/article-687-1.html

亮点:

// 源File对象
File source = new File("ajava.txt");

// 备份的File对象
File target = new File("ajava-backup.txt");

//通过JVM读取java.io.tmpdir属性取得临时文件夹
File targetDir = new File(System.getProperty("java.io.tmpdir"));

try
{
//在同一个文件夹复制文件
System.out.println("复制 " + source + " 文件到 " + target);
FileUtils.copyFile(source, target);

未知美人

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4